class MyMath {
  maxBy(array: any[], item: any) {
    array.sort(function (a, b) {
      return b[item] - a[item];
    });
    return array[0];
  }

  minBy(array: any[], item: any) {
    array.sort(function (a, b) {
      return a[item] - b[item];
    });

    return array[0];
  }
}

export default new MyMath();
